/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package be.contribute.pihome;

import be.contribute.pihome.ws.HomeService;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

/**
 *
 * @author debian
 */
@ApplicationPath("/")
public class PiHomeApplication extends Application {

    @Override
    public Set<Class<?>> getClasses() {
        final Set<Class<?>> classes = new HashSet<Class<?>>();
        // register root resource
        classes.add(HomeService.class);
        Thread harvestThread = new Thread(new PiHome());
        harvestThread.setDaemon(true); // important, otherwise JVM does not exit at end of main()
        harvestThread.start(); 
        return classes;
    } 
}
